import axios from 'axios';
import service from '../request';

const controller="/rolemenu";


/**
* 
* @param {*} data 
* @returns 
*/
function post(data:any) {
    return service({
        method: 'post',
        url: controller,
        data: data,      
    })
}
/*
修改用户
*/
function put(data:any) {
    return service({
        method: 'put',
        url: controller,
        data: data,      
    })
}
/*
@查询多条数据
**/
function query(data:any) {
    return service({
        method: 'get',
        url: controller,
        params: data,　　　　 
      
    }) 
}
/**
* 查找单个
* @param {*} data 只有数字
* /user/10
* @returns 
*/
function get(id:number) {
    return service({
        method: 'get',
        url: controller+"/"+id,
       // params: data,　　　　 
      
    }) 
}

/**
* 
* @param {*} data 
* @returns 
*/
function del(id:number) {
    return service({
        method: 'delete',
        url: controller+"/"+id,
        //params: data,　　　　 
      
    }) 
}
function rolemenu(data:any) {
    return service({
        method: 'get',
        url: controller+"/rolemenu",
        params: data,　　　　 
      
    }) 
}

function batch(data:any) {
    return service({
        method: 'post',
        url: controller+"/batch",
        data: data,      
    })
}
/**
* 树状图
* @param {*} data 
* @returns 
*/
function Tree() {
    return service({
        method: 'get',
        url: controller + "/tree",
    })
}

export default{
    post,
    del,
    get,
    put,
	query,
	rolemenu,
	batch,
	Tree
}